Open
Conversation
ninja-aruna
reviewed
Jan 10, 2025
| private ArrayList<Task> tasks = new ArrayList<>(); | ||
|
|
||
| ArrayList<Task> addTask(Task t) { | ||
| tasks.add(t); |
There was a problem hiding this comment.
I would check for duplicates before adding a task
ninja-aruna
reviewed
Jan 10, 2025
|
|
||
| public Task(String name, int id) { | ||
| this.name = name; | ||
| this.id = id; |
There was a problem hiding this comment.
Generally., IDs shou;ld be autogenerated in a Model to ensure consistency
ninja-aruna
reviewed
Jan 10, 2025
| if (t.getName().equals(taskName)) | ||
| return true; | ||
| } | ||
| return false; |
There was a problem hiding this comment.
Good work, but the requirement here was "I want to search for a task and receive a message that says it wasn't found
* if it doesn't exist."
ninja-aruna
reviewed
Jan 10, 2025
| try { | ||
| TimeUnit.SECONDS.sleep(1); | ||
| } catch (Exception e) { | ||
| System.err.println(e); |
There was a problem hiding this comment.
A try-catch oir if-else block in a test is usually not a good idea and it means the test boundary is incorrect. You can just assert that when a task is created, a date and time is set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.